package com.xjscrm.server.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xjscrm.common.entity.SopJob;
import com.xjscrm.common.entity.SopTask;
import com.xjscrm.server.dto.sopjob.SopJobQuery;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;

@Repository
public interface SopJobMapper {
    int deleteById(@Param("id") Long id);

    int insert(SopJob record);

    int insertSelective(SopJob record);

    SopJob selectById(@Param("id") Long id);

    SopJob selectUniqueByGroupWxid(@Param("groupWxid") String groupWxid, @Param("merId") Long merId);

    SopJob selectUniqueByTagSop(@Param("wxid") String wxid, @Param("deviceUniqueId") Long deviceUniqueId, @Param("taskId") Long taskId, @Param("merId") Long merId);

    int updateByIdSelective(SopJob record);

    int updateById(SopJob record);

    int updateStatusById(SopJob record);

    /**
     * 分页查询
     *
     * @param page
     * @param query
     * @return
     */
    ArrayList<SopJob> findByList(Page<SopJob> page, @Param("query") SopJobQuery query);
}